import vue from '@vitejs/plugin-vue';
import vueJsx from '@vitejs/plugin-vue-jsx';
import compression from "vite-plugin-compression";

import appInfo from './app-info.js';
import themePreprocessor from "./theme-preprocessor.js";
import createDevtools from './devtools.js';
import createVisualizer from "./visualizer.js";
import createAutoImport from './auto-import.js';
import createComponents from './components.js';

export default function createVitePlugins(viteEnv, isBuild = false) {
    const vitePlugins = [appInfo(), vue(), vueJsx()];
    vitePlugins.push(createDevtools(viteEnv));
    vitePlugins.push(compression());
    vitePlugins.push(themePreprocessor());
    vitePlugins.push(createVisualizer());
    vitePlugins.push(createAutoImport());
    vitePlugins.push(createComponents());
    return vitePlugins;
}